<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddSomeFieldToTasksTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('tasks', function (Blueprint $table) {
            $table->integer('count')->unsigned()->default(0)->after('carry_user_id')->comment('任务会员数量');
            $table->unsignedTinyInteger('status')->default(0)->after('count')->comment('0未完成1已完成2逾期3逾期未完成4逾期完成');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('tasks', function (Blueprint $table) {
            $table->dropColumn('count');
            $table->dropColumn('status');
        });
    }
}
